package com.cskaoyan.mapper;

import com.cskaoyan.bean.*;
import com.cskaoyan.bean.vo.goodsDetailNean.CommentBeanSon;
import com.cskaoyan.bean.vo.goodsDetailNean.SpecificationBean;
import com.cskaoyan.bean.vo.homeIndex.*;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author 杨杰
 * @version V1.0
 * @Package com.cskaoyan.mapper
 * @date 2020/12/8 19:15
 * @Copyright © 暂时还没有
 * @description  新建mapper，用于主页数据查询
 */
public interface IndexMapper {
    /*
    以下均为自己写的
     */

    List<NewGoods> queryNewGoods();
    //NewGoods[] queryNewGoods();

    List<HotGoodsIndex> queryHotGoods();

    List<CouponIndex> queryCoupons();

    List<ChannelIndex> queryChannels();

    List<GrouponIndex> queryGroupon();

    List<BannerIndex> queryBanner();

    List<BrandIndex> queryBrand();

    List<TopicIndex> queryTopic();

    Integer queryFloorId(@Param("c") String c);

    List<NewGoods> queryGoodsOfFloor(@Param("g") String g);

    int queryStatusOrderNum
            (@Param("userId") Integer id,@Param("status1") Integer status1,@Param("status2") Integer status2);

    List<NewGoods> queryGoodsByCategoryId(@Param("id") Integer id);
    int queryGoodsCountByCategoryId(@Param("id")Integer id);


    List<NewGoods> queryGoodsByBrandId(@Param("id")Integer id);
    int queryGoodsCountByBrandId(@Param("id")Integer id);

    Brand queryDetailBrandByBrandId(@Param("id")Integer id);
/*
以下为货物详情goodsDetail查询
 */
    //1.
    List<GoodsSpec> querySpecificationById(@Param("id")Integer id,@Param("spec")String specifition);

    //2.

    //3.
    List<Issue> queryIssue();
    //4.
    Integer queryCollectNum(@Param("id") Integer goodsId);
    //5
    String queryShareImageByGoodsId(@Param("id") Integer goodsId);
    //6
    List<CommentBeanSon> queryCommentByGoodsId(@Param("id")Integer id);
    //7
    List<GoodsAttribute> queryAttributeByGoodsId(@Param("id")Integer id);
    //8
    Brand queryDetailBrandByGoodsId(@Param("id")Integer id);
    //9
    List<GoodsProduct> queryProductBiGoodsId(@Param("id")Integer id);
    //10
    Goods queryAllGoodsInfoByGoodsId(@Param("id")Integer id);

    //    相似产品
    List<NewGoods> queryRelatedGoods(@Param("id")Integer id);

//
    List<NewGoods> queryGoodsByKeyword
    (@Param("keyword")String keyword,@Param("sort")String sort,@Param("order")String order);
    int queryGoodsCountByKeyword(@Param("keyword")String keyword);

    void insertHistory(@Param("id") int id, @Param("keyword")String keyword,@Param("from") String from,

                       @Param("add")Date add_time,@Param("update") Date update_time, @Param("deleted") int i);

    //删除超时物品
     void deleteOverTimeGroupon(@Param("now") Date now);
    //团购物品购买人数
    int queryCountGroupon(@Param("goodsId")Integer goodsId);

    //团购活动
    List<Groupon> queryGrouponRecord
            (@Param("goodsId") Integer goodsId, @Param("page") Integer page,
             @Param("limit") Integer limit, @Param("sort")String sort,@Param("order")String order);
}
